Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: move lighting tools to their own module to avoid circular import #89

Merged
merged 8 commits into from
Feb 4, 2025

Conversation

ianohara
Copy link
Collaborator

@ianohara ianohara commented Feb 3, 2025

When running tests, we'd get this:

tests/control/test_microscope.py:1: in <module>
    import control.microscope
control/microscope.py:7: in <module>
    import control.core.core as core
control/core/core.py:28: in <module>
    import control.serial_peripherals as serial_peripherals
control/serial_peripherals.py:6: in <module>
    from control.microscope import LightSourceType, IntensityControlMode, ShutterControlMode
E   ImportError: cannot import name 'LightSourceType' from partially initialized module 'control.microscope' (most likely due to a circular import) (/home/ian/projects/cephla/squid/software/control/microscope.py)

To fix this, move all the IlluminationController machinery to its own module.

Tested by: Unit tests run and pass now, and a local gui sim starts.

@ianohara ianohara force-pushed the ian/fix-lighting-circular-imports branch from 230a0dd to 1b0173a Compare February 4, 2025 01:15
@ianohara ianohara merged commit 6c35cd4 into master Feb 4, 2025
1 of 3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant